package com.denso.broadcast;

import com.xiaoleilu.hutool.io.resource.ClassPathResource;
import com.xiaoleilu.hutool.log.Log;
import com.xiaoleilu.hutool.log.LogFactory;
import javazoom.jl.player.Player;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

/**
 * Created by Administrator on 2017/12/6.
 */
public class Mp3Player {

    private static Log logger = LogFactory.get();

    public static void play() {
        try {
            ClassPathResource classPathResource = new ClassPathResource("airpot_once.mp3");
            InputStream ins = classPathResource.getStream();
            Player player = new Player(ins);
            player.play();
        } catch(Exception ex) {
            logger.error(ex);
        }
    }

    public static void main(String[] args) {
        for(int i = 0; i < 3; i++) {
            Mp3Player.play();
        }
    }
}
